﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Item.Master" AutoEventWireup="true"
    CodeBehind="AssociatedPagesAndButtons.aspx.cs" Inherits="SGDemo.Permission.AssociatedPagesAndButtons" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cpHeader" runat="server">
    <script src="AssociatedPagesAndButtons.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpBody" runat="server">
    <div class="ui-hidden">
        <dx:ASPxLabel ID="lblKeyid" ClientInstanceName="lblKeyid" runat="server" />
    </div>
    <dx:ASPxRoundPanel ID="rpRole" runat="server" Width="100%" HeaderText="岗位信息" Font-Bold="true" EnableViewState="false">
        <PanelCollection>
            <dx:PanelContent>
                <ul class="ui-list">
                    <li>
                        <dx:ASPxLabel ID="lblRoleName" runat="server" Text="岗位名称：" AssociatedControlID="txtRoleName" />
                    </li>
                    <li>
                        <dx:ASPxTextBox ID="txtRoleName" ClientInstanceName="txtRoleName" runat="server"
                            Width="120px">
                        </dx:ASPxTextBox>
                    </li>
                     <li>
                        <dx:ASPxLabel ID="lblRoleCode" runat="server" Text="岗位编码：" AssociatedControlID="txtRoleCode" />
                    </li>
                    <li>
                        <dx:ASPxTextBox ID="txtRoleCode" ClientInstanceName="txtRoleCode" runat="server"
                            Width="120px">
                        </dx:ASPxTextBox>
                    </li>
                    <li></li>
                    <li></li>
                    <li></li>
                    <li></li>
                </ul>
            </dx:PanelContent>
        </PanelCollection>
    </dx:ASPxRoundPanel>
    <dx:ASPxRoundPanel ID="rpPage" runat="server" Width="100%" HeaderText="页面列表" EnableViewState="false" Font-Bold="true">
        <PanelCollection>
            <dx:PanelContent>
                <ul class="ui-list">
                    <li>
                        <dx:ASPxLabel ID="lblModule" runat="server" Text="所属模块：" AssociatedControlID="cbModule" />
                    </li>
                    <li>
                        <dx:ASPxComboBox ID="cbModule" ClientInstanceName="cbModule" runat="server" Width="120">
                            <ClientSideEvents SelectedIndexChanged="doSelectedIndexChanged" />
                        </dx:ASPxComboBox>
                    </li> 
                    <li>
                        <dx:ASPxLabel ID="ASPxLabel1" runat="server" Text="关键字：" AssociatedControlID="txtKeyWords"  />
                    </li>
                    <li>
                        <dx:ASPxTextBox ID="txtKeyWords" ClientInstanceName="txtKeyWords" runat="server">
                        </dx:ASPxTextBox>
                    </li>
                    <li><div style=" padding-left:15px;">
                       <dx:ASPxButton ID="btnSearch" runat="server" Text="查 询"  AutoPostBack="false">
                        <ClientSideEvents Click="doSearch" />
                       </dx:ASPxButton>
                       </div>
                    </li>
                    <li>
                        
                    </li>
                </ul>
                <div id="listall" class="ui-content-item ui-content-item-selected">
                    <%--gvwPageList--%>
                    <dx:ASPxGridView ID="gvwPageList" ClientInstanceName="gvwPageList" runat="server"
                        AutoGenerateColumns="False" DataSourceID="odsModuleList" Width="100%" KeyFieldName="Keyid"
                        OnCustomCallback="gvwList_CustomCallback">
                        <Columns>
                            <dx:GridViewDataColumn Caption="是否拥有权限" Width="90" HeaderStyle-HorizontalAlign="Center"
                                CellStyle-HorizontalAlign="Center">
                                <DataItemTemplate>
                                    <dx:ASPxCheckBox ID="cbSelectPageItem" runat="server" Checked='<%# Eval("IsSelected") %>'>
                                        <ClientSideEvents CheckedChanged="doCheckedChanged_Page" />
                                    </dx:ASPxCheckBox>
                                    <label class="keyidField" style="display: none;">
                                        <%#Eval("Keyid") %></label>
                                </DataItemTemplate>
                            </dx:GridViewDataColumn>
                            <dx:GridViewDataColumn Caption="页面名称" FieldName="Name" VisibleIndex="1" Width="260">
                            </dx:GridViewDataColumn>
                            <dx:GridViewDataColumn Caption="页面编码" FieldName="Code" VisibleIndex="2">
                            </dx:GridViewDataColumn>
                            <dx:GridViewDataColumn Caption="所属模块名称" FieldName="ParentName" VisibleIndex="3">
                            </dx:GridViewDataColumn>
                            <dx:GridViewDataColumn Caption="所属模块编码" FieldName="ParentCode" VisibleIndex="4">
                            </dx:GridViewDataColumn>
                        </Columns>
                        <ClientSideEvents RowDblClick="doRowDblClick" />
                        <SettingsBehavior AllowFocusedRow="true" AllowGroup="true" AutoExpandAllGroups="true" />
                        <SettingsLoadingPanel Text="加载中..." />
                        <SettingsPager PageSize="10" Mode="ShowPager" Summary-Text="当前第{0}页，共{1}页(共{2 }条)">
                        </SettingsPager>
                        <SettingsText EmptyDataRow="没有数据显示" GroupContinuedOnNextPage="(下页续)" />
                        <Styles>
                            <AlternatingRow Enabled="True" />
                        </Styles>
                    </dx:ASPxGridView>
                    <%--数据源控件--%>
                    <asp:ObjectDataSource ID="odsModuleList" runat="server" TypeName="SGDemo.Permission.PagesAndButtonsDataSource"
                        SelectMethod="GetDetailsByRoleKeyidAndModuleKeyid">
                        <SelectParameters>
                            <asp:ControlParameter Name="filterConditions" Type="String" ControlID="hfModuleFilterCondition"
                                PropertyName="Value" ConvertEmptyStringToNull="false" />
                            <asp:QueryStringParameter Name="roleKeyid" QueryStringField="Keyid" Type="String" />
                        </SelectParameters>
                    </asp:ObjectDataSource>
                    <%--存储过滤条件--%>
                    <asp:HiddenField ID="hfModuleFilterCondition" ClientIDMode="Static" runat="server"
                        Value=" " />
                </div>
            </dx:PanelContent>
        </PanelCollection>
    </dx:ASPxRoundPanel>
    <dx:ASPxRoundPanel ID="rpButton" ClientInstanceName="rpButton" runat="server" Width="100%" HeaderText="按钮列表" Font-Bold="true" EnableViewState="false">
        <PanelCollection>
            <dx:PanelContent>
              <%--<div>
                 <dx:ASPxCheckBox ID="cbChooseAll" ClientInstanceName="cbChooseAll" Text="全选" runat="server">
                    <ClientSideEvents CheckedChanged="cbChoose_click" />
                </dx:ASPxCheckBox>
              </div>--%>
                <div class="ui-content-item ui-content-item-selected">
                    <dx:ASPxGridView ID="gvwButtonList" ClientInstanceName="gvwButtonList" runat="server"
                        AutoGenerateColumns="False" DataSourceID="odsButtonList" Width="100%" KeyFieldName="Keyid"
                        OnCustomCallback="gvwList_CustomCallback_Button">
                        <Columns>
                            <dx:GridViewDataColumn Caption="是否拥有权限" Width="90"  HeaderStyle-HorizontalAlign="Center"
                                CellStyle-HorizontalAlign="Center">
                                <DataItemTemplate>
                                    <dx:ASPxCheckBox ID="cbSelectButtonItem" runat="server" Checked='<%# Eval("IsSelected") %>'>
                                        <ClientSideEvents CheckedChanged="doCheckedChanged_Button" />
                                    </dx:ASPxCheckBox>
                                    <label class="keyidField" style="display: none;">
                                        <%#Eval("Keyid") %></label>
                                </DataItemTemplate>
                            </dx:GridViewDataColumn>
                            <dx:GridViewDataColumn Caption="按钮名称" FieldName="Name" VisibleIndex="1" Width="260">
                            </dx:GridViewDataColumn>
                            <dx:GridViewDataColumn Caption="按钮编码" FieldName="Code" VisibleIndex="2">
                            </dx:GridViewDataColumn>
                            <dx:GridViewDataColumn Caption="所属页面名称" FieldName="ParentName" VisibleIndex="3">
                            </dx:GridViewDataColumn>
                            <dx:GridViewDataColumn Caption="所属页面编码" FieldName="ParentCode" VisibleIndex="4">
                            </dx:GridViewDataColumn>
                        </Columns>
                        <SettingsBehavior AllowFocusedRow="true" AllowGroup="true" AutoExpandAllGroups="true" />
                        <SettingsLoadingPanel Text="加载中..." />
                        <SettingsPager  AlwaysShowPager="false" Mode="ShowAllRecords" Summary-Text="当前第{0}页，共{1}页(共{2 }条)">
                        </SettingsPager>
                        <SettingsText EmptyDataRow="没有数据显示" />
                        <Styles>
                            <AlternatingRow Enabled="True" />
                        </Styles>
                    </dx:ASPxGridView>
                    <%--数据源控件--%>
                    <asp:ObjectDataSource ID="odsButtonList" runat="server" TypeName="SGDemo.Permission.PagesAndButtonsDataSource"
                        SelectMethod="GetDetailsByRoleKeyidAndPageKeyid">
                        <SelectParameters>
                            <asp:ControlParameter Name="pageKeyid" Type="String" ControlID="hfButtonFilterCondition"
                                PropertyName="Value" ConvertEmptyStringToNull="false" />
                            <asp:QueryStringParameter Name="roleKeyid" QueryStringField="Keyid" Type="String" />
                        </SelectParameters>
                    </asp:ObjectDataSource>
                    <%--存储过滤条件--%>
                    <asp:HiddenField ID="hfButtonFilterCondition" ClientIDMode="Static" runat="server"
                        Value=" " />
                </div>
            </dx:PanelContent>
        </PanelCollection>
    </dx:ASPxRoundPanel>
</asp:Content>
